package com.aspose.cells;

import java.util.Iterator;

public class ShapePathCollection extends CollectionBase {
   private Shape e;
   long b = 0L;
   long c = 0L;
   boolean d = true;

   ShapePathCollection(Shape shape) {
      this.e = shape;
      zbjo var2 = this.e.N().c().c(323);
      if (var2 != null) {
         this.b = (long)(Integer)var2.d();
      }

      zbjo var3 = this.e.N().c().c(322);
      if (var3 != null) {
         this.c = (long)(Integer)var3.d();
      }

      this.c();
   }

   public int getCount() {
      return this.a.size();
   }

   public ShapePath get(int index) {
      return (ShapePath)this.a.get(index);
   }

   public int add() {
      ShapePath var1 = new ShapePath();
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var1);
      return this.a.size() - 1;
   }

   int a(ShapePath var1) {
      com.aspose.cells.b.a.a.ze.a(this.a, (Object)var1);
      return this.a.size() - 1;
   }

   int a() {
      int var1 = 0;

      for(int var2 = 0; var2 < this.getCount(); ++var2) {
         var1 += this.get(var2).a();
      }

      return var1;
   }

   void b() {
      this.b = 0L;
      this.c = 0L;

      for(int var1 = 0; var1 < this.getCount(); ++var1) {
         ShapePath var2 = this.get(var1);

         for(int var3 = 0; var3 < var2.getPathSegementList().getCount(); ++var3) {
            ShapeSegmentPath var4 = var2.getPathSegementList().get(var3);
            ShapePathPointCollection var5 = var4.getPoints();
            if (var5.getCount() > 0) {
               for(int var6 = 0; var6 < var5.getCount(); ++var6) {
                  ShapePathPoint var7 = var5.get(var6);
                  if (var7.getX() > 65535 || var7.getX() < 0 || var7.getY() > 65535 || var7.getY() < 0) {
                     this.d = false;
                  }

                  if ((long)var7.getX() > this.c) {
                     this.c = (long)var7.getX();
                  }

                  if ((long)var7.getY() > this.b) {
                     this.b = (long)var7.getY();
                  }

                  if ((long)var7.getX() > var2.e) {
                     var2.e = (long)var7.getX();
                  }

                  if ((long)var7.getY() > var2.d) {
                     var2.d = (long)var7.getY();
                  }
               }
            }
         }
      }

   }

   private void c() {
      this.e.N().a(this);

      for(int var1 = 0; var1 < this.getCount(); ++var1) {
         ShapePath var2 = this.get(var1);
         var2.e = this.c;
         var2.d = this.b;
      }

   }

   void a(ShapePathCollection var1) {
      Iterator var2 = var1.iterator();

      while(var2.hasNext()) {
         ShapePath var3 = (ShapePath)var2.next();
         ShapePath var4 = new ShapePath();
         var4.a(var3);
         this.a(var4);
      }

   }
}
